//
//  Student.m
//  DebugDemo
//
//  Created by XFB on 2018/11/14.
//  Copyright © 2018年 ZhouCheng. All rights reserved.
//

#import "Student.h"

@implementation Student


//- (void)setName:(NSString *)name
//{
//    _name = [name copy];
//}

/**
 调整模式，默认是自动模式，YES
 */
//+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key
//{
//    if ([key isEqualToString:@"name"]) {
//        return NO;
//    }
//    return YES;
//}
//
//- (instancetype)init
//{
//    self = [super init];
//    if (self) {
//        _cat = [[Cat alloc] init];
//    }
//    return self;
//}



/**
 让用户

 @param key <#key description#>
 @return <#return value description#>
 */
//+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key
//{
//    NSLog(@"%@", key);
//
//    NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
//    if ([key isEqualToString:@"cat"]) {
//        keyPaths = [[NSSet alloc] initWithObjects:@"_cat.age", @"_cat.level", nil];
//    }
//    return keyPaths;
//}


/**
 KVO底层实现
 1、创建一个子类 NSKVONotyfing_Person
 2、重写setName方法
 3、改变外面isa指针
 
 SDWebImage源码
 AFNetworking
 Alamofire
 Masony
 FMDB
 YYCache
 PNChart
 MJRefresh
 MJExtension
 YTKnetwork
 理解
 
 
 */

- (void)setName:(NSString *)name
{
    _name = [name stringByAppendingString:@"zhoucheng"];
}



@end
